<template>
  <div>
    <van-row type="flex" justify="space-between">
      <van-col span="2"
        ><img
          @click="funh"
          class="img1"
          src=""
          alt=""
      /></van-col>
      <van-col span="18">
        <van-search
          v-model="value"
          shape="round"
          background="#fff"
          :placeholder="count"
        />
      </van-col>
      <van-col class="txt" span="4"
        ><van-button type="primary" @click="funs">搜索</van-button></van-col
      >
    </van-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      value: "",
      arr: [],
            show:[
                "铝框拉杆箱",
        "不锈钢蒸锅",
        "多美鲜黄油",
        "欧式吊灯",
        "婴儿爬行垫",
        "白板",
        "多功能沙发床",
        "电话交换机",
        "脸部卸妆油",
      ],
      count:''
    };
  },
  methods: {
    funh() {
      this.$router.back()
    },
    funs() {
      if (this.value != "") {
        this.arr.push(this.value);
        this.$bus.$emit("aMsg", this.arr);
        this.value = ''
      }
      this.$router.push('/Searchk').catch((err) => {})
    },
  },
  mounted(){
   this.count  = this.show[Math.floor(Math.random()*this.show.length)]
    this.$bus.$on('none',(none)=>{
      this.arr = none
    })
  }
};
</script>

<style scoped>
.van-row {
  width: 100vw;
  background: #fff;
  height: 11.7333vw;
  align-items: center;
  margin-bottom: 0.5333vw;
}
.van-col {
  text-align: center;
}
.img1 {
  width: 5.3333vw;
  height: 4.8vw;
  vertical-align: middle;
}
.van-search {
  width: 100%;
  height: 8vw;
}
.van-button {
  width: 10.6667vw;
  height: 7.3vw;
  font-size: 3.7333vw;
  padding: 0;
  background: rgb(239, 58, 58);
  border-radius: 1.0667vw;
  border: none;
}
</style>